package siau.android.base;

import com.google.gson.Gson;

import java.util.ArrayList;

import hhm.android.http.ASEJava;
import hhm.android.http.ResultFunc;
import hhm.android.http.ResultListFunc;
import hhm.android.http.RxHelper;
import io.reactivex.rxjava3.core.Observable;
import siau.android.http.InterfaceService;
import siau.android.http.SBRetrofitClient;
import siau.android.http.SignRequest;
import siau.android.http.model.AddDeviceResponse;
import siau.android.http.model.AdvertisementModel;
import siau.android.http.model.FamilyCountModel;
import siau.android.http.model.FlutterUrlModel;
import siau.android.http.model.GetAnalyseDateResponse;
import siau.android.http.model.GetBrushListResponse;
import siau.android.http.model.GetQiNiuInfoResponse;
import siau.android.http.model.ChildIdModel;
import siau.android.http.model.ChildModel;
import siau.android.http.model.DeviceModel;
import siau.android.http.model.FamilyListResponse;
import siau.android.http.model.FootRecordResponse;
import siau.android.http.model.FriendModel;
import siau.android.http.model.GetDefaultFamilyResponse;
import siau.android.http.model.GetListType2Response;
import siau.android.http.model.GetListTypeResponse;
import siau.android.http.model.GetRemainingTimeResponse;
import siau.android.http.model.GrowTrendResponse;
import siau.android.http.model.HomeResponse;
import siau.android.http.model.IsExistModel;
import siau.android.http.model.ListHistoryModel;
import siau.android.http.model.LoginResponse;
import siau.android.http.model.MessageListResponse;
import siau.android.http.model.ShoeSizeListModel;
import siau.android.http.model.SystemMessageListResponse;
import siau.android.http.model.UpdateModel;
import siau.android.http.model.UserInfoModel;
import siau.android.http.model.WXLoginResponse;

public class InterfaceAPI {

    private final InterfaceService interfaceService;

    public InterfaceAPI(String url) {
        interfaceService = new SBRetrofitClient(url).getInterfaceService();
    }

    public Observable<Object> getCaptcha(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getCaptcha(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<LoginResponse> smsLogin(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.smsLogin(signRequest).flatMap(new ResultFunc<>(LoginResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<LoginResponse> passwordLogin(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.passwordLogin(signRequest).flatMap(new ResultFunc<>(LoginResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> createFamily(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.createFamily(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<LoginResponse> refreshToken(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.refreshToken(signRequest).flatMap(new ResultFunc<>(LoginResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetDefaultFamilyResponse> getDefaultFamily() {
        return interfaceService.getDefaultFamily().flatMap(new ResultFunc<>(GetDefaultFamilyResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<HomeResponse> getChildHomeData(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getChildHomeData(signRequest).flatMap(new ResultFunc<>(HomeResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<FootRecordResponse> getFootRecord(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getFootRecord(signRequest).flatMap(new ResultFunc<>(FootRecordResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<ChildIdModel> addChild(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.addChild(signRequest).flatMap(new ResultFunc<>(ChildIdModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GrowTrendResponse> growTrend(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.growTrend(signRequest).flatMap(new ResultFunc<>(GrowTrendResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<ArrayList<ListHistoryModel>> listHistory(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.listHistory(signRequest).flatMap(new ResultListFunc<ArrayList<ListHistoryModel>, ListHistoryModel>(ListHistoryModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> deleteHistory(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.deleteHistory(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<FamilyListResponse> getFamilyList() {
        return interfaceService.getFamilyList().flatMap(new ResultFunc<>(FamilyListResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetDefaultFamilyResponse> changeFamily(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.changeFamily(signRequest).flatMap(new ResultFunc<>(GetDefaultFamilyResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> recordWeight(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.recordWeight(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> recordHeight(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.recordHeight(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> recordFootSize(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.recordFootSize(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<ArrayList<ChildModel>> myBabyList() {
        return interfaceService.myBabyList().flatMap(new ResultListFunc<ArrayList<ChildModel>, ChildModel>(ChildModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<ArrayList<FriendModel>> friendList() {
        return interfaceService.friendList().flatMap(new ResultListFunc<ArrayList<FriendModel>, FriendModel>(FriendModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetDefaultFamilyResponse> quitFamily(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.quitFamily(signRequest).flatMap(new ResultFunc<>(GetDefaultFamilyResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> deleteFamilyMember(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.deleteFamilyMember(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> deleteChild(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.deleteChild(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<ChildModel> getChildInfo(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getChildInfo(signRequest).flatMap(new ResultFunc<>(ChildModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> editChild(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.editChild(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> changeIdentity(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.changeIdentity(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetDefaultFamilyResponse> scanAddFamily(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.scanAddFamily(signRequest).flatMap(new ResultFunc<>(GetDefaultFamilyResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> forgetPassword(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.forgetPassword(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<UserInfoModel> getUserInfo() {
        return interfaceService.getUserInfo().flatMap(new ResultFunc<>(UserInfoModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> editUserInfo(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.editUserInfo(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> setPassword(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.setPassword(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> changePassword(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.changePassword(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<WXLoginResponse> getWXInfo(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getWXInfo(signRequest).flatMap(new ResultFunc<>(WXLoginResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> unBindWx() {
        return interfaceService.unBindWx().flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> bindWx(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.bindWx(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<MessageListResponse> getMessageList(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getMessageList(signRequest).flatMap(new ResultFunc<>(MessageListResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> readMark(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.readMark(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> hideNotify(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.hideNotify(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<SystemMessageListResponse> getSystemMessageList(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getSystemMessageList(signRequest).flatMap(new ResultFunc<>(SystemMessageListResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<ArrayList<DeviceModel>> getBindDeviceList() {
        return interfaceService.getBindDeviceList().flatMap(new ResultListFunc<ArrayList<DeviceModel>, DeviceModel>(DeviceModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetListTypeResponse> getListType(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getListType(signRequest).flatMap(new ResultFunc<>(GetListTypeResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetListType2Response> getListType2(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getListType2(signRequest).flatMap(new ResultFunc<>(GetListType2Response.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetQiNiuInfoResponse> getQiNiuInfo() {
        return interfaceService.getQiNiuInfo().flatMap(new ResultFunc<>(GetQiNiuInfoResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> changePhone(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.changePhone(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> clickPushMessage(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.clickPushMessage(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> downloadResource(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.downloadResource(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<UpdateModel> getUpdateInfo(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getUpdateInfo(signRequest).flatMap(new ResultFunc<>(UpdateModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<ArrayList<Long>> getAnalyseDates(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getAnalyseDates(signRequest).flatMap(new ResultListFunc<ArrayList<Long>, Long>(Long.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetAnalyseDateResponse> getAnalyseDate(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getAnalyseDate(signRequest).flatMap(new ResultFunc<>(GetAnalyseDateResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<AddDeviceResponse> addDevice(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.addDevice(signRequest).flatMap(new ResultFunc<>(AddDeviceResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> unbindDevice(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.unbindDevice(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<IsExistModel> checkCanBindBluetooth(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.checkCanBindBluetooth(signRequest).flatMap(new ResultFunc<>(IsExistModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<ArrayList<ShoeSizeListModel>> shoeSizeList() {
        return interfaceService.shoeSizeList().flatMap(new ResultListFunc<ArrayList<ShoeSizeListModel>, ShoeSizeListModel>(ShoeSizeListModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> swapShoeSizeType(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.swapShoeSizeType(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> makeOverFamily(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.makeOverFamily(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<FamilyCountModel> familyCount() {
        return interfaceService.familyCount().flatMap(new ResultFunc<>(FamilyCountModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> swapUnit(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.swapUnit(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<AdvertisementModel> checkAd() {
        return interfaceService.checkAd().flatMap(new ResultFunc<>(AdvertisementModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> hideAd(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.hideAd(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<FlutterUrlModel> communityActivityDetail(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.communityActivityDetail(signRequest).flatMap(new ResultFunc<>(FlutterUrlModel.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetRemainingTimeResponse> getRemainingTime(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getRemainingTime(signRequest).flatMap(new ResultFunc<>(GetRemainingTimeResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<GetBrushListResponse> getBrushList(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.getBrushList(signRequest).flatMap(new ResultFunc<>(GetBrushListResponse.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> updateDeviceInfo(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.updateDeviceInfo(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }

    public Observable<Object> updateCid(Object a) throws Exception {
        SignRequest signRequest = new SignRequest(ASEJava.aesEncrypt(new Gson().toJson(a)));
        return interfaceService.updateCid(signRequest).flatMap(new ResultFunc<>(Object.class)).onErrorResumeNext(new ThrowableFunc<>()).compose(RxHelper.INSTANCE.rxSchedulerHelper());
    }
}
